<?php

namespace app\common\validate\Product;

use think\Validate;

class Product extends Validate
{
    protected $rule = [
        'name' => ['require', 'unique:product'],
        'flag' => ['require'],
        'typeid' => ['require'],
        'unitid' => ['require'],
        'price' => ['require'],
        'rent' => ['require'],
        'rent_price' => ['require'],
        'rentstatus' => ['require'],

    ];

    // 错误提示信息
    protected $message = [
        'name.require' => '分类名称必填',
        'name.unique' => '分类名称已存在',
        'flag.require' => '标签必填',
        'typeid.require' => '分类外键必填',
        'unitid.require' => '商品单位必填',
        'price.require' => '商品价格必填',
        'rent.require' => '押金必填',
        'rent_price.require' => '日租必填',
        'rentstatus.require' => '商品租赁状态必填',
    ];
}
